package com.libl.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.libl.mapper.DtsUserMapper;
import com.libl.mapper.StatMapper;
import com.libl.pojo.DtsUser;
import com.libl.service.DtsUserService;
import com.libl.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DtsUserServiceImpl implements DtsUserService {
    @Autowired
    DtsUserMapper userMapper;

    @Autowired
    StatMapper statMapper;

    @Override
    public int getTotal() {
        LambdaQueryWrapper<DtsUser> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsUser::getDeleted, false);

        Integer count = userMapper.selectCount(wrapper);
        return count;
    }

    @Override
    public List<DayStatis> findUserDayStatis() {
        return statMapper.findUserDayStatis();
    }
}
